package com.ruicar.afs.cloud.afscase.risk.service;

import com.ruicar.afs.cloud.afscase.approveprev.entity.CaseApprovePrevInfo;
import com.ruicar.afs.cloud.common.core.util.SpringContextHolder;
import com.ruicar.afs.cloud.risk.api.dto.tortoise.TortoiseResultNotice;
import com.ruicar.afs.cloud.risk.api.dto.tortoise.TortoiseQueryBean;
import com.ruicar.afs.cloud.risk.api.dto.tortoise.request.TortoiseFraudPushData;
import com.ruicar.afs.cloud.risk.api.enums.tortoise.GwtTortoiseAntiFraudCallStep;
import com.ruicar.afs.cloud.risk.api.enums.tortoise.GwtTortoiseStartApproveType;
import com.ruicar.afs.cloud.risk.api.service.AfsRiskControlService;

/**
 * @Description 玄武业务数据获取service
 * @Author Peng Jinbo
 * @Date 2020/07/24 14:45
 */
public interface CaseTortoiseService {

    /**
     * Author Peng Jinbo
     * Signal apply
     * 正式进件
     *
     * @param applyNo apply no
     */
    void signalApply(String applyNo,GwtTortoiseStartApproveType startApproveType);

    /**
     * Author Peng Jinbo
     * Signal apply
     * 正式进件
     *
     * @param applyNo apply no
     */
    void signalApply(String applyNo,boolean isHandInvoke,GwtTortoiseStartApproveType startApproveType);

    /**
     * Author Peng Jinbo
     * Signal prev
     * 预审批/二手车预授信
     *
     * @param prevInfo prev approve data
     */
    void signalPrev(CaseApprovePrevInfo prevInfo);

    /**
     * Author Peng Jinbo
     * Signal fraud push
     * 欺诈信息推送
     *
     * @param fraudPushData fraud push data
     */
    void signalFraudPush(TortoiseFraudPushData fraudPushData, GwtTortoiseAntiFraudCallStep antiFraudCallStep);

    void signalFraudHand(String applyNo, GwtTortoiseAntiFraudCallStep antiFraudCallStep, GwtTortoiseStartApproveType startApproveType);

    /**
     * Author Peng Jinbo
     * Signal fraud push
     * 欺诈信息推送，将已保存的信息推送至玄武
     *
     * @param applyNo
     */
    void signalFraudPush(String applyNo);

    void signalFraudPush(String applyNo,GwtTortoiseStartApproveType startApproveType);

    /**
     * Author Peng Jinbo
     * Signal fraud hand
     * 手动触发反欺诈
     *
     * @param applyNo apply no
     */
    void signalFraudHand(String applyNo, GwtTortoiseAntiFraudCallStep antiFraudCallStep);


    /**
     * Author Peng Jinbo
     * Safe sign fraud hand *
     * 无异常调用反欺诈触发
     *
     * @param applyNo  apply no
     * @param callStep call step
     */
    void safeSignalFraudHand(String applyNo,GwtTortoiseAntiFraudCallStep callStep);

    void safeSignalFraudHand(String applyNo,GwtTortoiseAntiFraudCallStep callStep, GwtTortoiseStartApproveType startApproveType);

    /**
     * Author Peng Jinbo
     * Safe delay sign fraud hand *
     * 延迟一秒调用玄武反欺诈
     *
     * @param applyNo  apply no
     * @param callStep call step
     */
    void safeDelaySignFraudHand(String applyNo, GwtTortoiseAntiFraudCallStep callStep);

    void safeDelaySignFraudHand(final String applyNo,final GwtTortoiseAntiFraudCallStep callStep,final GwtTortoiseStartApproveType startApproveType);

    /**
     * Author Peng Jinbo
     * Signal decision hand
     * 决策引擎手工调用
     *
     * @param applyNo apply no
     */
    void signalDecisionHand(String applyNo);

    /**
     * Author Peng Jinbo
     * Before sign check *
     * 除001场景外，发起调用前需检查是否调用过001
     *
     * @param applyNo apply no
     */
    void beforeSignalCheck(String applyNo);

    /**
     * Author Peng Jinbo
     * Query notice tortoise result notice
     * 通知数据查询
     * @param queryBean query bean
     * @return the tortoise result notice
     */
    default TortoiseResultNotice queryNotice(TortoiseQueryBean queryBean){
        return SpringContextHolder.getBean(AfsRiskControlService.class).queryNotice(queryBean);
    }

    /**
     * add by fangchenliang
     * 同盾报告
     * @param applyNo
     */
    void downloadTdReport(String applyNo);

    /***
     * add by fangchenliang
     * 车e估车辆评估报告
     */
    void downloadECarReport(String applyNo);

    /***
     * add by ice
     * 根据图片网络地址下载图片
     */
    void downloadPictureByUrl(String id,String carId,String imgUrl,String remake);
}
